package com.star.percalservice.controller;

import com.star.percalservice.model.entity.ScoreRule;
import com.star.percalservice.service.ScoreRuleService;
import com.star.percalservice.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author star
 * @version 1.0
 * @Description:
 * @DateTime 2025/4/13 2:10
 */

@RestController
@RequestMapping("/api/score-rule")
public class ScoreRuleController {

    @Autowired
    private ScoreRuleService scoreRuleService;

    @GetMapping("/list")
    public R list() {
        return scoreRuleService.list();
    }

    @PostMapping("/add")
    public R add(@RequestBody ScoreRule scoreRule) {
        return scoreRuleService.add(scoreRule);
    }

    @PostMapping("/update")
    public R update(@RequestBody ScoreRule scoreRule) {
        return scoreRuleService.update(scoreRule);
    }

    @PostMapping("/delete")
    public R delete(Integer id) {
        return scoreRuleService.delete(id);
    }


}
